import request from "../request"

const fileListURL = "/file/list"
const fileExistURL = "/file/exsit"
const fileDeleteURL = "/file/delete"
const fileRenameURL = "/file/rename"

export const getFiles = (params) => {
    return request({
        url: fileListURL,
        // url:"/file/list?pageNum="+data.pageNum+"&pageSize="+data.pageSize+ "&searchValue="+data.searchValue,
        method: "get",
        params // 使用 params 会自动拼接参数
    })
}

// 查询实体文件是否存在
export const exitsFile = (params) => {
    return request({
        url: fileExistURL,
        // url:"/file/exsit?uuid="+fileUuid,
        method: "get",
        params
    })
}

export const deleteFile = (data) => {
    
    return request({
        url: fileDeleteURL,
        method: "delete",
        contentType: 'text/plain',
        data // data就会自动放在body里面
    })
}

export const renameFile = (data) => {
    return request({
        url: fileRenameURL,
        method: "post",
        data
    })
}
